#include <iostream>
#include <vector>
#include <unordered_map>

using namespace std;

vector<int> partitionLabels(string s) {
    vector<int> ret;
    unordered_map<char, int> hash;
    int scanedMaxPos = 0;
    int n = s.size();
    int start = 0;

    for (int i = 0; i < n; ++i)
        hash[s[i]] = i;

    for (int i = 0; i < n; ++i)
    {
        int currentMaxPos = hash[s[i]];
        if (currentMaxPos > scanedMaxPos)
            scanedMaxPos = currentMaxPos;
        if (i == scanedMaxPos)
        {
            ret.push_back(i + 1 - start);
            start = i + 1;
        }
    }

    return ret;
}

int main()
{

	return 0;
}